package com.ml.loan.common.config;

import com.ibeetl.starter.BeetlTemplateCustomize;
import com.ml.loan.common.shiro.ShiroExt;
import com.ml.loan.common.utils.ConfigUtils;
import com.ml.loan.common.utils.DictUtils;
import com.ml.loan.common.utils.StringUtils;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description beetl配置
 * @Author mickey
 * @Date 2019/4/28 11:02
 **/
@Configuration
public class MyBeetlConfig {

    /**
     * @param
     * @return com.ibeetl.starter.BeetlTemplateCustomize
     * @Description beetl自定义标签
     * @Author mickey
     * @Date 2019/4/28 11:09
     **/
    @Bean
    public BeetlTemplateCustomize beetlTemplateCustomize() {
        return groupTemplate -> {
            //权限判断
            groupTemplate.registerFunctionPackage("hbShiro", new ShiroExt());
            //字典
            groupTemplate.registerFunctionPackage("dict", new DictUtils());
            //字符串操作
            groupTemplate.registerFunctionPackage("StringUtils", new StringUtils());
            //系统配置
            groupTemplate.registerFunctionPackage("ConfigUtils", new ConfigUtils());
        };
    }

}
